﻿using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Threading.Tasks;
using Acme.BookStore.Purchase.Otherwarehousing; // 引入你的Service和DTO命名空间

namespace Acme.BookStore.Controllers
{
    [Route("api/app/merged-warehouse")]
    [ApiController]
    public class MergedWarehouseController : ControllerBase
    {
        private readonly OtherwarehousingServices _otherwarehousingServices;

        public MergedWarehouseController(OtherwarehousingServices otherwarehousingServices)
        {
            _otherwarehousingServices = otherwarehousingServices;
        }

        /// <summary>
        /// 四表联查，返回合并后的所有字段数据
        /// </summary>
        [HttpGet("all")]
        public async Task<List<OtherwarehousingServices.MergedWarehouseReceiptDto>> GetAllMergedWarehouseDataAsync()
        {
            return await _otherwarehousingServices.GetMergedWarehouseReceiptAsync();
        }
    }
}
